<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Jailer - Filters</title></head>
<body>
<table border="0" cellpadding="0" cellspacing="0" height="542" width="98%">
<tbody>

<tr>
<td class="content" height="520" valign="top" width="100%">
A filter assigns an SQL expression to a table column.

<h3>Export filter</h3>

An export filter is evaluated during the export phase. <br>
The column values are replaced by the result of the expression when the export file is written.<br>
${old-value} is a synonym for the filtered column.<br>
<br><br>With the filter

EMPLOYEE.NAME := lower(${old-value})

<br><br>
<img src="filterimg/image001.png"/>
<br><br> ... the names of the employees are exported with lowercase letters:
<br><br>
<img src="filterimg/image002.png"/>
<h3>Literal filter</h3>

A literal filter is also evaluated during the export phase.<br>
The result is written literally to the export file.<br>
In the import phase, it is evaluated as an SQL expression.<br>
To define a literal filter, add the prefix "literal:" to the filter expression.<br><br>
The filter:<br />
<img src="filterimg/image003.png"/>
<br><br>replaces employee names with numbers from a sequence in the target database.<br><br>
<img src="filterimg/image004.png"/>
<br><br><h3>Import filter</h3>

An import filter is evaluated during the import phase.<br>
Import filters are especially useful for filtering primary key columns. <br> <br>
Filters on primary key columns are automatically applied to the corresponding foreign key columns. <br>
An import filter ensures that a "null" value remains null and that a foreign key value maps to the same <br>
value as the primary key, even if the filter expression is not a deterministic function. <br>
(More precisely, if the filter expressions and types of any two filters are exactly the same for two different columns, <br>
then both filters will map each value to exactly the same target value.)

<br><br>This filter uses a sequence to generate new EMPNOs during the import phase:

<br><br><img src="filterimg/image005.png"/>
<br><br><br>
<h3>Filter templates</h3>
Templates allow defining filters of the same kind for a set of columns that satisfy a given condition.
<br><br><img src="filterimg/image007.png"/>
</td>

</tr>
</tbody>
</table>

</body></html>